<%@page import="com.zkingsoft.constance.SystemConstance"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<c:set var="plat_factory" value="<%=SystemConstance.PLAT_FACTORY%>" />
<c:set var="plat_hotel" value="<%=SystemConstance.PLAT_HOTEL%>" />
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<!-- 视口标签 -->
<meta name="divport"
	content="width=device-width, initial-scale=1, user-scalable=no" />
<!-- 删除苹果默认的工具栏和菜单栏 -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<!-- 设置苹果工具栏颜色 -->
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<!-- 忽略页面中的数字识别为电话，忽略email识别 -->
<meta name="format-detection" content="telphone=no, email=no" />
<!-- 启用360浏览器的极速模式(webkit) -->
<meta name="renderer" content="webkit">
<!-- 避免IE使用兼容模式 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- 针对手持设备优化，主要是针对一些老的不识别divport的浏览器，比如黑莓 -->
<meta name="HandheldFriendly" content="true">
<!-- 微软的老式浏览器 -->
<meta name="MobileOptimized" content="320">
<!-- uc强制竖屏 -->
<meta name="screen-orientation" content="portrait">
<!-- QQ强制竖屏 -->
<meta name="x5-orientation" content="portrait">
<!-- UC强制全屏 -->
<meta name="full-screen" content="yes">
<!-- QQ强制全屏 -->
<meta name="x5-fullscreen" content="true">
<!-- UC应用模式 -->
<meta name="browsermode" content="application">
<!-- QQ应用模式 -->
<meta name="x5-page-mode" content="app">
<!-- windows phone 点击无高光 -->
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<!-- 适应移动端end -->
<title>登录</title>

<link rel="stylesheet" type="text/css" href="${path }/resource/css/mobile/base.css" />
<link rel="stylesheet" type="text/css" href="${path }/resource/css/mobile/index.css" />

<script type="text/javascript" src="${path }/resource/js/plugin/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="${path }/resource/js/systools/AjaxProxy.js"></script>
<script type="text/javascript" src="${path }/resource/js/systools/MTools.js"></script>
</head>
<body>
	<div class="wrap">
<!-- 		<header class="header"> -->
<!-- 			<h3>登录</h3> -->
<!-- 		</header> -->
		<div class="logo-area"></div>
		<section class="form-area">
<!-- 			<form action="" method="post"> -->
				<div class="input-group">
					<i class="formico"></i>
					<input type="text" id="account" class="inputcon" placeholder="请输入您的帐号" />
				</div>
				<div class="input-group">
					<i class="formico fpwd"></i>
					<input type="password" id="password" class="inputcon" placeholder="请输入您的密码" />
				</div>
				<div class="inputbtn">
					<input type="button" id="subtn" class="subbtn" value="登录" />
				</div>
<!-- 			</form> -->
		</section>
	</div>
	
	<script type="text/javascript" src="${path }/resource/plugin/layer/layer.js"></script>
	<script type="text/javascript">
		$('#subtn').click(function() {
			if ($("#account").val() == "") {
				layer.tips('请输入账号！', '#account', { tips: 1 });
				return false;
			} else if ($("#password").val() == "") {
				layer.tips('请输入密码！', '#password', { tips: 1 });
				return false;
			}
			// 开启遮罩
			layer.load(2, {
				time : 10 * 1000,
				shade : [ 0.4, '#aeaeae' ]
			});
			
			$.ajax({
				type : "post",
				url : "${path}/app/user/login",
				data : {
					suAccount : $("#account").val(),
					suPassword : $("#password").val()
				},
				dataType: 'json',
				async : false,
				success : function(result) {
					console.log(result);
					// 全局异常处理器发出的错误信息
					layer.closeAll('loading');
					if (result.status == "ok") {
						MTools.redirect("${path}/app/order/toOrderList");
					} else {
						layer.msg(result.info, {
							icon : 2,time:1000
						});
						return null;
					}
				},
				error : function(XMLHttpRequest, textStatus, errorThrown) {
					layer.closeAll('loading');
					layer.msg("请求遇到问题-错误编号：" + XMLHttpRequest.status, {
						icon : 2
					});
					return null;
				},
			});
// 			$.AjaxProxy({
// 				p : {
// 					suAccount : $("#account").val(),
// 					suPassword : $("#password").val()
// 				}
// 			}).invoke("${path}/app/user/login", function(loj) {
// // 				MTools.redirect("${path}/" + loj.getValue("page"));
// 				console.log(loj);
// 			});
		})
	</script>
</body>
</html>
